package orchestration.persistence;

import android.net.Uri;
import android.provider.BaseColumns;

public class OrchestratorAuthority {

	public static final String AUTHORITY = "orchestration.android.provider.Orchestrator";

	private OrchestratorAuthority() {
	}
	
	public static final class AndroidProcess implements BaseColumns {
        // This class cannot be instantiated
        private AndroidProcess() {}
        
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/processes");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of processes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.orchestrator.process";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single process.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.orchestrator.process";

        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "name DESC";

        /**
         * The name of the process
         * <P>Type: TEXT</P>
         */
        public static final String NAME = "name";

        /**
         * The path to the xml file that describes the process
         * <P>Type: TEXT</P>
         */
        public static final String PATH = "path";
    }
	public static final class AndroidProcessExecution implements BaseColumns {
        // This class cannot be instantiated
        private AndroidProcessExecution() {}
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/process_executions");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of process executions.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.orchestrator.execution";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single process.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.orchestrator.execution";

        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "name ASC";

        /**
         * The name of the process_execution
         * <P>Type: TEXT</P>
         */
        public static final String NAME = "name";
        
        /**
         * The reference to the process (it's id)
         * <P>Type: TEXT</P>
         */
        public static final String PROCESS_REF = "process";
        
        /**
         * The nodestack of the process_execution, containing nodes that are waiting to be visited
         * <P>Type: TEXT, each nodeId is separated by a single space</P>
         */
        public static final String TOVISIT= "toVisit";
        /**
         * The nodes already visited by this process_execution
         * <P>Type: TEXT, each nodeId is separated by a single space</P>
         */
        public static final String VISITED= "visited";
        /**
         * "new" -> the process_execution have never been launched (have to visit StartEvent and load the input)
         * "ended" -> the execution reached an EndEvent,
         * "" -> normal execution
         * <P>Type: TEXT</P>
         */
        public static final String EXECUTION_STATUS= "status";
        /**
         * 
         * the current node of the process_execution
         */
        public static final String CURRENT="current";
        /**
         * 
         * the encrypted key that must be matched to use this process_execution
         */
        public static final String KEY="lockingkey";
	}
	
	public static final class AndroidProcessExecutionProperty implements BaseColumns{
		/**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/process_executions_property");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of process executions.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.orchestrator.property";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single process.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.orchestrator.property";
        /**
         * The reference to the execution (it's id)
         * <P>Type: TEXT</P>
         */
		public static final String EXECUTION_REF= "execution";
		/**
         * The reference to the artifact in the model (it's id)
         * <P>Type: TEXT</P>
         */
		public static final String ARTIFACT_REF= "artifact";
		/**
         * The value itself, saved as a String
         * <P>Type: TEXT</P>
         */
		public static final String VALUE= "value";
	}
        
	
}
